package day1;
//定义一个汽车类 Car
//        属性有：颜色、品牌、价格
//        行为有：前进、后退、转弯和输出对象属性
public class Car {
    private String color;
    private String brand;
    private  double price;

    public Car(String color, String brand, double price) {
        this.color = color;
        this.brand = brand;
        this.price = price;
    }

    //前进
    public void forward(){
        System.out.println( "汽车正在前进");
    }
    //后退
    public void backward(){
        System.out.println("汽车正在后退");
    }
    public void turn(){
        System.out.println("汽车正在转弯");
    }
    public void show(){
        System.out.println("颜色:"+color+" 品牌:"+brand+" 价格："+price);
    }
}
